import request from '@/router/axios';
export const getOrderForDelivery = (query) => {
  return request({
    url: '/api/xmbz-order/orderDispatch/getOrderForDelivery',
    method: 'get',
    params: query
  })
}

// 总仓列表接口
// export const getMainWarehouseList = (query) => {
//   return request({
//     url: '/api/xmbz-order/order/getMainWarehouseList',
//     method: 'get',
//     params: query
//   })
// }

// 分仓列表接口
// export const getSeparateWarehouseList = (query) => {
//   return request({
//     url: '/api/xmbz-order/order/getSeparateWarehouseList',
//     method: 'get',
//     params: query
//   })
// }
// 总仓列表接口（根据系统管理角色来设置的）
export const getMainWarehouseList = (query) => {
  return request({
    // url: 'http://192.168.2.11:8107/order/getMainWarehouseListByRoleIdAll',
    url: '/api/xmbz-order/order/getMainWarehouseListByRoleIdAll',
    method: 'get',
    params: query
  })
}
export const getMainWarehouseListAll = (query) => {
  return request({
    url: '/api/xmbz-order/order/getMainWarehouseListByRoleIdAll',
    method: 'get',
    params: query
  })
}
// 总仓列表接口（根据系统管理角色来设置的）
export const getSeparateWarehouseList = (query) => {
  return request({
    // url: 'http://192.168.2.11:8107/order/getSeparateWarehouseListByRoleIdAll',
    url: '/api/xmbz-order/order/getSeparateWarehouseListByRoleIdAll',
    method: 'get',
    params: query
  })
}

// 获取订单状态列表
export const getOrderStatus = (query) => {
  return request({
    url: '/api/xmbz-order/orderDispatch/getOrderStatus',
    method: 'get',
    params: query
  })
}
//配送列表
export function getdeliveriesList(query) {
  return request({
    url: '/api/xmbz-order/orderDispatch/deliveries',
    method: 'get',
    params: query
  })
}
export function distributeDeliveryForOrder(data) {
  return request({
    url: '/api/xmbz-order/orderDispatch/distributeDeliveryForOrder',
    method: 'post',
    data
  })
}
export function distributeDeliveryForOrderDispatch(data) {
  return request({
    url: '/api/xmbz-order/orderDispatch/distributeDeliveryForOrderDispatch',
    method: 'post',
    data
  })
}
export function distributeDeliveryForOrderMyDistribution(data) {
  return request({
    url: '/api/xmbz-order/orderDispatch/distributeDeliveryForOrderMyDistribution',
    method: 'post',
    data
  })
}


//订单信息

export function getOrderInfo(query) {
  return request({
    url: '/api/xmbz-order/order/getOrderInfo',
    method: 'get',
    params: query
  })
}
// 日志列表
export const getOrderOperateLog = (query) => {
  return request({
    url: '/api/xmbz-work/work/getOrderOperateLog',
    method: 'get',
    params: query
  })
}
//商品信息
export function getOrderGoodsInfo(query) {
  return request({
    url: '/api/xmbz-order/order/getOrderGoodsInfo',
    method: 'get',
    params: query
  })
}

//
// 获取配送分配页面总仓和分仓的数据
export function getEveryAreaDeliveryNum(query) {
  return request({
    url: '/api/xmbz-order/orderDispatch/getEveryAreaDeliveryNum',
     // url: 'http://192.168.2.11:8107/orderDispatch/getEveryAreaDeliveryNum',
    method: 'get',
    params: query
  })
}
//获取配送分配页面未分配列表
export const getorderNotDeliveryInfos = (query) => {
  return request({
    url: '/api/xmbz-order/orderDispatch/getOrderNotDeliveryInfo',
     // url: 'http://192.168.2.11:8107/orderDispatch/getOrderNotDeliveryInfo',
    method: 'get',
    params: query
  })
}
export const getOrderDeliveryInfoByDelivery = (query) => {
  return request({
    url: '/api/xmbz-order/orderDispatch/getOrderDeliveryInfoByDelivery',
    // url: 'http://192.168.2.11:8107/orderDispatch/getOrderDeliveryInfoByDelivery',
    method: 'get',
    params: query
  })
}
// 配送出发
export const deliverySetOutOrder = (data) => {
  return request({
    url: '/api/xmbz-order/orderDispatch/deliverySetOutOrder',
    method: 'post',
    data
  })
}
export const getOrderDeliveryAbnormalList = (query) => {
  return request({
    url: '/api/xmbz-order/orderDispatch/getOrderDeliveryAbnormalList',
    method: 'get',
    params: query
  })
}
// 驳回配送异常订单
export const rejectOrderDeliveryAbnormal = (query) => {
  return request({
    url: '/api/xmbz-order/orderDispatch/rejectOrderDeliveryAbnormal',
    method: 'post',
    params: query
  })
}
export const turnWorkOrderDeliveryAbnormal = (query) => { // 配送异常订单转给客服
  return request({
    url: '/api/xmbz-order/orderDispatch/turnWorkOrderDeliveryAbnormal',
    method: 'post',
    params: query
  })
}
export const modifyOrderDeliveryAbnormal = (query) => { // 修改配送异常订单的配送员
  return request({
    url: '/api/xmbz-order/orderDispatch/modifyOrderDeliveryAbnormal',
    method: 'post',
    params: query
  })
}
export const getWorkOnDeliverySituation = (query) => { //配送情况（当天的）
  return request({
    url: '/api/xmbz-order/order/getWorkOnDeliverySituation',
    method: 'get',
    params: query
  })
}
export const getWarehouseList = (query) => { //获取仓库名字和经纬度
  return request({
    url: '/api/xmbz-order/orderDispatch/getWarehouseList',
    method: 'get',
    params: query
  })
}
export const getOrderWorkOnDeliverySituation = (query) => { //查询单个订单配送情况
  return request({
    url: '/api/xmbz-order/order/getOrderWorkOnDeliverySituation',
    method: 'get',
    params: query
  })
}
export const clearNewsLogRecord = (data) => { //清除异常订单记录
  return request({
    url: '/api/xmbz-order/orderNewsLog/clearRecord',
    method: 'post',
    data
  })
}
export const getOrderPhone = (params) => { //获取电话号码
  return request({
    url: '/api/xmbz-order/orderDispatch/getOrderPhone',
    method: 'get',
    params
  })
}